<!-- HTML header for doxygen 1.8.6-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/xhtml;charset=utf-8" http-equiv="Content-Type"/>
<meta content="IE=9" http-equiv="X-UA-Compatible"/>
<meta content="Doxygen 1.8.13" name="generator"/>
<title>OpenCV: Face Analysis</title>
<link href="../../opencv.ico" rel="shortcut icon" type="image/x-icon"/>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script src="../../jquery.js" type="text/javascript"></script>
<script src="../../dynsections.js" type="text/javascript"></script>
<script src="../../tutorial-utils.js" type="text/javascript"></script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script src="../../search/searchdata.js" type="text/javascript"></script>
<script src="../../search/search.js" type="text/javascript"></script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
//<![CDATA[
MathJax.Hub.Config(
{
  TeX: {
      Macros: {
          matTT: [ "\\[ \\left|\\begin{array}{ccc} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{array}\\right| \\]", 9],
          fork: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ \\end{array} \\right.", 4],
          forkthree: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ \\end{array} \\right.", 6],
          forkfour: ["\\left\\{ \\begin{array}{l l} #1 & \\mbox{#2}\\\\ #3 & \\mbox{#4}\\\\ #5 & \\mbox{#6}\\\\ #7 & \\mbox{#8}\\\\ \\end{array} \\right.", 8],
          vecthree: ["\\begin{bmatrix} #1\\\\ #2\\\\ #3 \\end{bmatrix}", 3],
          vecthreethree: ["\\begin{bmatrix} #1 & #2 & #3\\\\ #4 & #5 & #6\\\\ #7 & #8 & #9 \\end{bmatrix}", 9],
          cameramatrix: ["#1 = \\begin{bmatrix} f_x & 0 & c_x\\\\ 0 & f_y & c_y\\\\ 0 & 0 & 1 \\end{bmatrix}", 1],
          distcoeffs: ["(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \\tau_x, \\tau_y]]]]) \\text{ of 4, 5, 8, 12 or 14 elements}"],
          distcoeffsfisheye: ["(k_1, k_2, k_3, k_4)"],
          hdotsfor: ["\\dots", 1],
          mathbbm: ["\\mathbb{#1}", 1],
          bordermatrix: ["\\matrix{#1}", 1]
      }
  }
}
);
//]]>
</script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js" type="text/javascript"></script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css"/>
<link href="../../stylesheet.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<!--#include virtual="/google-search.html"-->
<table cellpadding="0" cellspacing="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../opencv-logo-small.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">OpenCV
    <span id="projectnumber">4.5.2</span>
   </div>
   <div id="projectbrief">Open Source Computer Vision</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
<script src="../../menudata.js" type="text/javascript"></script>
<script src="../../menu.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
  initMenu('../../',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow" onkeydown="return searchBox.OnSearchSelectKey(event)" onmouseout="return searchBox.OnSearchSelectHide()" onmouseover="return searchBox.OnSearchSelectShow()">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe frameborder="0" id="MSearchResults" name="MSearchResults" src="javascript:void(0)">
</iframe>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> |
<a href="#typedef-members">Typedefs</a> |
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Face Analysis</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/dd7/classcv_1_1face_1_1BasicFaceRecognizer.html">cv::face::BasicFaceRecognizer</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d8/dd8/structcv_1_1face_1_1CParams.html">cv::face::CParams</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d7c/classcv_1_1face_1_1EigenFaceRecognizer.html">cv::face::EigenFaceRecognizer</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d5/d7b/classcv_1_1face_1_1FacemarkAAM.html">cv::face::FacemarkAAM</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dc/d63/classcv_1_1face_1_1FacemarkLBF.html">cv::face::FacemarkLBF</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d3/d81/classcv_1_1face_1_1FacemarkTrain.html">cv::face::FacemarkTrain</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Abstract base class for trainable facemark models.  <a href="../../d3/d81/classcv_1_1face_1_1FacemarkTrain.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../dd/d65/classcv_1_1face_1_1FaceRecognizer.html">cv::face::FaceRecognizer</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Abstract base class for all face recognition models.  <a href="../../dd/d65/classcv_1_1face_1_1FaceRecognizer.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d2/de9/classcv_1_1face_1_1FisherFaceRecognizer.html">cv::face::FisherFaceRecognizer</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../df/d25/classcv_1_1face_1_1LBPHFaceRecognizer.html">cv::face::LBPHFaceRecognizer</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d9/d5c/classcv_1_1face_1_1MACE.html">cv::face::MACE</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Minimum Average Correlation Energy Filter useful for authentication with (cancellable) biometrical features. (does not need many positives to train (10-50), and no negatives at all, also robust to noise/salting)  <a href="../../d9/d5c/classcv_1_1face_1_1MACE.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../da/d6a/classcv_1_1face_1_1PredictCollector.html">cv::face::PredictCollector</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Abstract base class for all strategies of prediction result handling.  <a href="../../da/d6a/classcv_1_1face_1_1PredictCollector.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:"><td align="right" class="memItemLeft" valign="top">class  </td><td class="memItemRight" valign="bottom"><a class="el" href="../../d4/d8d/classcv_1_1face_1_1StandardCollector.html">cv::face::StandardCollector</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Default predict collector.  <a href="../../d4/d8d/classcv_1_1face_1_1StandardCollector.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gae0bc3cfe0eb0cccde1fc0d91c6cde9db"><td align="right" class="memItemLeft" valign="top">typedef bool(* </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#gae0bc3cfe0eb0cccde1fc0d91c6cde9db">cv::face::FN_FaceDetector</a>) (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a>, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a>, void *userData)</td></tr>
<tr class="separator:gae0bc3cfe0eb0cccde1fc0d91c6cde9db"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga318d9669d5ed4dfc6ab9fae2715310f5"><td align="right" class="memItemLeft" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#ga318d9669d5ed4dfc6ab9fae2715310f5">cv::face::drawFacemarks</a> (<a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> points, <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> color=<a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(255, 0, 0))</td></tr>
<tr class="memdesc:ga318d9669d5ed4dfc6ab9fae2715310f5"><td class="mdescLeft"> </td><td class="mdescRight">Utility to draw the detected facial landmark points.  <a href="../../db/d7c/group__face.html#ga318d9669d5ed4dfc6ab9fae2715310f5">More...</a><br/></td></tr>
<tr class="separator:ga318d9669d5ed4dfc6ab9fae2715310f5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga62cec28ecffa694e1efb272ff0c65da2"><td align="right" class="memItemLeft" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#ga62cec28ecffa694e1efb272ff0c65da2">cv::face::getFaces</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> faces, <a class="el" href="../../d8/dd8/structcv_1_1face_1_1CParams.html">CParams</a> *params)</td></tr>
<tr class="memdesc:ga62cec28ecffa694e1efb272ff0c65da2"><td class="mdescLeft"> </td><td class="mdescRight">Default face detector This function is mainly utilized by the implementation of a <a class="el" href="../../db/dd8/classcv_1_1face_1_1Facemark.html" title="Abstract base class for all facemark models. ">Facemark</a> <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html" title="This is a base class for all more or less complex algorithms in OpenCV. ">Algorithm</a>. End users are advised to use function Facemark::getFaces which can be manually defined and circumvented to the algorithm by Facemark::setFaceDetector.  <a href="../../db/d7c/group__face.html#ga62cec28ecffa694e1efb272ff0c65da2">More...</a><br/></td></tr>
<tr class="separator:ga62cec28ecffa694e1efb272ff0c65da2"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga64a534740d4c9aa0489da85b431fec47"><td align="right" class="memItemLeft" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#ga64a534740d4c9aa0489da85b431fec47">cv::face::getFacesHAAR</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> image, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> faces, const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp;face_cascade_name)</td></tr>
<tr class="separator:ga64a534740d4c9aa0489da85b431fec47"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga02020fc9f387bb043a478fe5f112bb8d"><td align="right" class="memItemLeft" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#ga02020fc9f387bb043a478fe5f112bb8d">cv::face::loadDatasetList</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> imageList, <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> annotationList, std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp;images, std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp;annotations)</td></tr>
<tr class="memdesc:ga02020fc9f387bb043a478fe5f112bb8d"><td class="mdescLeft"> </td><td class="mdescRight">A utility to load list of paths to training image and annotation file.  <a href="../../db/d7c/group__face.html#ga02020fc9f387bb043a478fe5f112bb8d">More...</a><br/></td></tr>
<tr class="separator:ga02020fc9f387bb043a478fe5f112bb8d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gab70c6fb08756f867d6160099907202a5"><td align="right" class="memItemLeft" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#gab70c6fb08756f867d6160099907202a5">cv::face::loadFacePoints</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> filename, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> points, float offset=0.0f)</td></tr>
<tr class="memdesc:gab70c6fb08756f867d6160099907202a5"><td class="mdescLeft"> </td><td class="mdescRight">A utility to load facial landmark information from a given file.  <a href="../../db/d7c/group__face.html#gab70c6fb08756f867d6160099907202a5">More...</a><br/></td></tr>
<tr class="separator:gab70c6fb08756f867d6160099907202a5"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gacd36ecb8de65bd12d8420d4a0ae98a4b"><td align="right" class="memItemLeft" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#gacd36ecb8de65bd12d8420d4a0ae98a4b">cv::face::loadTrainingData</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> filename, std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp;images, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> facePoints, char delim=' ', float offset=0.0f)</td></tr>
<tr class="memdesc:gacd36ecb8de65bd12d8420d4a0ae98a4b"><td class="mdescLeft"> </td><td class="mdescRight">A utility to load facial landmark dataset from a single file.  <a href="../../db/d7c/group__face.html#gacd36ecb8de65bd12d8420d4a0ae98a4b">More...</a><br/></td></tr>
<tr class="separator:gacd36ecb8de65bd12d8420d4a0ae98a4b"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga9bbdd4136cc1eee55586b5f115d8a3a8"><td align="right" class="memItemLeft" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#ga9bbdd4136cc1eee55586b5f115d8a3a8">cv::face::loadTrainingData</a> (<a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> imageList, <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> groundTruth, std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp;images, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> facePoints, float offset=0.0f)</td></tr>
<tr class="memdesc:ga9bbdd4136cc1eee55586b5f115d8a3a8"><td class="mdescLeft"> </td><td class="mdescRight">A utility to load facial landmark information from the dataset.  <a href="../../db/d7c/group__face.html#ga9bbdd4136cc1eee55586b5f115d8a3a8">More...</a><br/></td></tr>
<tr class="separator:ga9bbdd4136cc1eee55586b5f115d8a3a8"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac3a2d046686d932425d2601b640d97d3"><td align="right" class="memItemLeft" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d7c/group__face.html#gac3a2d046686d932425d2601b640d97d3">cv::face::loadTrainingData</a> (std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; filename, std::vector&lt; std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">Point2f</a> &gt; &gt; &amp;trainlandmarks, std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp;trainimages)</td></tr>
<tr class="memdesc:gac3a2d046686d932425d2601b640d97d3"><td class="mdescLeft"> </td><td class="mdescRight">This function extracts the data for training from .txt files which contains the corresponding image name and landmarks. The first file in each file should give the path of the image whose landmarks are being described in the file. Then in the subsequent lines there should be coordinates of the landmarks in the image i.e each line should be of the form x,y where x represents the x coordinate of the landmark and y represents the y coordinate of the landmark.  <a href="../../db/d7c/group__face.html#gac3a2d046686d932425d2601b640d97d3">More...</a><br/></td></tr>
<tr class="separator:gac3a2d046686d932425d2601b640d97d3"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<a id="details" name="details"></a><h2 class="groupheader">Detailed Description</h2>
<ul>
<li><a class="el" href="../../d5/d47/tutorial_table_of_content_facemark.html">Tutorial on Facial Landmark Detector API</a></li>
<li>The <a class="el" href="../../db/dd8/classcv_1_1face_1_1Facemark.html" title="Abstract base class for all facemark models. ">Facemark</a> API</li>
<li><a class="el" href="../../d9/d47/face_changelog.html">Face module changelog</a></li>
<li><a class="el" href="../../da/d60/tutorial_face_main.html">Face Recognition with OpenCV</a> </li>
</ul>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="gae0bc3cfe0eb0cccde1fc0d91c6cde9db"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae0bc3cfe0eb0cccde1fc0d91c6cde9db">◆ </a></span>FN_FaceDetector</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef bool(* cv::face::FN_FaceDetector) (<a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a>, <a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a>, void *userData)</td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga318d9669d5ed4dfc6ab9fae2715310f5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga318d9669d5ed4dfc6ab9fae2715310f5">◆ </a></span>drawFacemarks()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cv::face::drawFacemarks </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaf77c9a14ef956c50c1efd4547f444e63">InputOutputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a> </td>
          <td class="paramname"><em>color</em> = <code><a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(255, 0, 0)</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>image</td><td>=</td><td>cv.face.drawFacemarks(</td><td class="paramname">image, points[, color]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
<p>Utility to draw the detected facial landmark points. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>The input image to be processed. </td></tr>
    <tr><td class="paramname">points</td><td>Contains the data of points which will be drawn. </td></tr>
    <tr><td class="paramname">color</td><td>The color of points in BGR format represented by <a class="el" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">cv::Scalar</a>.</td></tr>
  </table>
  </dd>
</dl>
<p><b>Example of usage</b> </p><div class="fragment"><div class="line">std::vector&lt;Rect&gt; faces;</div><div class="line">std::vector&lt;std::vector&lt;Point2f&gt; &gt; landmarks;</div><div class="line">facemark-&gt;getFaces(img, faces);</div><div class="line">facemark-&gt;fit(img, faces, landmarks);</div><div class="line"><span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;rects.size();j++){</div><div class="line">    <a class="code" href="../../db/d7c/group__face.html#ga318d9669d5ed4dfc6ab9fae2715310f5">face::drawFacemarks</a>(frame, landmarks[j], <a class="code" href="../../dc/d84/group__core__basic.html#ga599fe92e910c027be274233eccad7beb">Scalar</a>(0,0,255));</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a id="ga62cec28ecffa694e1efb272ff0c65da2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga62cec28ecffa694e1efb272ff0c65da2">◆ </a></span>getFaces()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::face::getFaces </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>faces</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d8/dd8/structcv_1_1face_1_1CParams.html">CParams</a> * </td>
          <td class="paramname"><em>params</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
<p>Default face detector This function is mainly utilized by the implementation of a <a class="el" href="../../db/dd8/classcv_1_1face_1_1Facemark.html" title="Abstract base class for all facemark models. ">Facemark</a> <a class="el" href="../../d3/d46/classcv_1_1Algorithm.html" title="This is a base class for all more or less complex algorithms in OpenCV. ">Algorithm</a>. End users are advised to use function Facemark::getFaces which can be manually defined and circumvented to the algorithm by Facemark::setFaceDetector. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">image</td><td>The input image to be processed. </td></tr>
    <tr><td class="paramname">faces</td><td>Output of the function which represent region of interest of the detected faces. Each face is stored in <a class="el" href="../../dc/d84/group__core__basic.html#ga11d95de507098e90bad732b9345402e8">cv::Rect</a> container. </td></tr>
    <tr><td class="paramname">params</td><td>detector parameters</td></tr>
  </table>
  </dd>
</dl>
<p><b>Example of usage</b> </p><div class="fragment"><div class="line">std::vector&lt;cv::Rect&gt; faces;</div><div class="line">CParams <a class="code" href="../../d1/dae/namespacecv_1_1gapi_1_1ie.html#a3ab1729bcaf2d08e30dd2bc645410908">params</a>(<span class="stringliteral">"haarcascade_frontalface_alt.xml"</span>);</div><div class="line"><a class="code" href="../../db/d7c/group__face.html#ga62cec28ecffa694e1efb272ff0c65da2">cv::face::getFaces</a>(frame, faces, &amp;<a class="code" href="../../d1/dae/namespacecv_1_1gapi_1_1ie.html#a3ab1729bcaf2d08e30dd2bc645410908">params</a>);</div><div class="line"><span class="keywordflow">for</span>(<span class="keywordtype">int</span> j=0;j&lt;faces.size();j++){</div><div class="line">    <a class="code" href="../../d6/d6e/group__imgproc__draw.html#ga07d2f74cadcf8e305e810ce8eed13bc9">cv::rectangle</a>(frame, faces[j], <a class="code" href="../../d1/da0/classcv_1_1Scalar__.html">cv::Scalar</a>(255,0,255));</div><div class="line">}</div><div class="line"><a class="code" href="../../d7/dfc/group__highgui.html#ga453d42fe4cb60e5723281a89973ee563">cv::imshow</a>(<span class="stringliteral">"detection"</span>, frame);</div></div><!-- fragment --> 
</div>
</div>
<a id="ga64a534740d4c9aa0489da85b431fec47"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga64a534740d4c9aa0489da85b431fec47">◆ </a></span>getFacesHAAR()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::face::getFacesHAAR </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga353a9de602fe76c709e12074a6f362ba">InputArray</a> </td>
          <td class="paramname"><em>image</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>faces</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &amp; </td>
          <td class="paramname"><em>face_cascade_name</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, faces</td><td>=</td><td>cv.face.getFacesHAAR(</td><td class="paramname">image, face_cascade_name[, faces]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
</div>
</div>
<a id="ga02020fc9f387bb043a478fe5f112bb8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga02020fc9f387bb043a478fe5f112bb8d">◆ </a></span>loadDatasetList()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::face::loadDatasetList </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td>
          <td class="paramname"><em>imageList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td>
          <td class="paramname"><em>annotationList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp; </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp; </td>
          <td class="paramname"><em>annotations</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.face.loadDatasetList(</td><td class="paramname">imageList, annotationList, images, annotations</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
<p>A utility to load list of paths to training image and annotation file. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">imageList</td><td>The specified file contains paths to the training images. </td></tr>
    <tr><td class="paramname">annotationList</td><td>The specified file contains paths to the training annotations. </td></tr>
    <tr><td class="paramname">images</td><td>The loaded paths of training images. </td></tr>
    <tr><td class="paramname">annotations</td><td>The loaded paths of annotation files.</td></tr>
  </table>
  </dd>
</dl>
<p>Example of usage: </p><div class="fragment"><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> imageFiles = <span class="stringliteral">"images_path.txt"</span>;</div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> ptsFiles = <span class="stringliteral">"annotations_path.txt"</span>;</div><div class="line">std::vector&lt;String&gt; images_train;</div><div class="line">std::vector&lt;String&gt; landmarks_train;</div><div class="line"><a class="code" href="../../db/d7c/group__face.html#ga02020fc9f387bb043a478fe5f112bb8d">loadDatasetList</a>(imageFiles,ptsFiles,images_train,landmarks_train);</div></div><!-- fragment --> 
</div>
</div>
<a id="gab70c6fb08756f867d6160099907202a5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab70c6fb08756f867d6160099907202a5">◆ </a></span>loadFacePoints()</h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::face::loadFacePoints </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>points</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float </td>
          <td class="paramname"><em>offset</em> = <code>0.0f</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, points</td><td>=</td><td>cv.face.loadFacePoints(</td><td class="paramname">filename[, points[, offset]]</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
<p>A utility to load facial landmark information from a given file. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filename</td><td>The filename of file contains the facial landmarks data. </td></tr>
    <tr><td class="paramname">points</td><td>The loaded facial landmark points. </td></tr>
    <tr><td class="paramname">offset</td><td>An offset value to adjust the loaded points.</td></tr>
  </table>
  </dd>
</dl>
<p><b>Example of usage</b> </p><div class="fragment"><div class="line">std::vector&lt;Point2f&gt; points;</div><div class="line"><a class="code" href="../../db/d7c/group__face.html#gab70c6fb08756f867d6160099907202a5">face::loadFacePoints</a>(<span class="stringliteral">"filename.txt"</span>, points, 0.0f);</div></div><!-- fragment --><p>The annotation file should follow the default format which is </p><div class="fragment"><div class="line">version: 1</div><div class="line">n_points:  68</div><div class="line">{</div><div class="line">212.716603 499.771793</div><div class="line">230.232816 566.290071</div><div class="line">...</div><div class="line">}</div></div><!-- fragment --><p> where n_points is the number of points considered and each point is represented as its position in x and y. </p>
</div>
</div>
<a id="gacd36ecb8de65bd12d8420d4a0ae98a4b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacd36ecb8de65bd12d8420d4a0ae98a4b">◆ </a></span>loadTrainingData() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::face::loadTrainingData </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp; </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>facePoints</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char </td>
          <td class="paramname"><em>delim</em> = <code>' '</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float </td>
          <td class="paramname"><em>offset</em> = <code>0.0f</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, facePoints</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">filename, images[, facePoints[, delim[, offset]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>retval, facePoints</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">imageList, groundTruth, images[, facePoints[, offset]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">filename, trainlandmarks, trainimages</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
<p>A utility to load facial landmark dataset from a single file. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filename</td><td>The filename of a file that contains the dataset information. Each line contains the filename of an image followed by pairs of x and y values of facial landmarks points separated by a space. Example <div class="fragment"><div class="line">/home/user/ibug/image_003_1.jpg 336.820955 240.864510 334.238298 260.922709 335.266918 ...</div><div class="line">/home/user/ibug/image_005_1.jpg 376.158428 230.845712 376.736984 254.924635 383.265403 ...</div></div><!-- fragment --> </td></tr>
    <tr><td class="paramname">images</td><td>A vector where each element represent the filename of image in the dataset. Images are not loaded by default to save the memory. </td></tr>
    <tr><td class="paramname">facePoints</td><td>The loaded landmark points for all training data. </td></tr>
    <tr><td class="paramname">delim</td><td>Delimiter between each element, the default value is a whitespace. </td></tr>
    <tr><td class="paramname">offset</td><td>An offset value to adjust the loaded points.</td></tr>
  </table>
  </dd>
</dl>
<p><b>Example of usage</b> </p><div class="fragment"><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a> imageFiles = <span class="stringliteral">"../data/images_train.txt"</span>;</div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a> ptsFiles = <span class="stringliteral">"../data/points_train.txt"</span>;</div><div class="line">std::vector&lt;String&gt; images;</div><div class="line">std::vector&lt;std::vector&lt;Point2f&gt; &gt; facePoints;</div><div class="line"><a class="code" href="../../db/d7c/group__face.html#gacd36ecb8de65bd12d8420d4a0ae98a4b">loadTrainingData</a>(imageFiles, ptsFiles, images, facePoints, 0.0f);</div></div><!-- fragment --> 
</div>
</div>
<a id="ga9bbdd4136cc1eee55586b5f115d8a3a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9bbdd4136cc1eee55586b5f115d8a3a8">◆ </a></span>loadTrainingData() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::face::loadTrainingData </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td>
          <td class="paramname"><em>imageList</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> </td>
          <td class="paramname"><em>groundTruth</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp; </td>
          <td class="paramname"><em>images</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../dc/d84/group__core__basic.html#gaad17fda1d0f0d1ee069aebb1df2913c0">OutputArray</a> </td>
          <td class="paramname"><em>facePoints</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float </td>
          <td class="paramname"><em>offset</em> = <code>0.0f</code> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, facePoints</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">filename, images[, facePoints[, delim[, offset]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>retval, facePoints</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">imageList, groundTruth, images[, facePoints[, offset]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">filename, trainlandmarks, trainimages</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
<p>A utility to load facial landmark information from the dataset. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">imageList</td><td>A file contains the list of image filenames in the training dataset. </td></tr>
    <tr><td class="paramname">groundTruth</td><td>A file contains the list of filenames where the landmarks points information are stored. The content in each file should follow the standard format (see <a class="el" href="../../db/d7c/group__face.html#gab70c6fb08756f867d6160099907202a5" title="A utility to load facial landmark information from a given file. ">face::loadFacePoints</a>). </td></tr>
    <tr><td class="paramname">images</td><td>A vector where each element represent the filename of image in the dataset. Images are not loaded by default to save the memory. </td></tr>
    <tr><td class="paramname">facePoints</td><td>The loaded landmark points for all training data. </td></tr>
    <tr><td class="paramname">offset</td><td>An offset value to adjust the loaded points.</td></tr>
  </table>
  </dd>
</dl>
<p><b>Example of usage</b> </p><div class="fragment"><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a> imageFiles = <span class="stringliteral">"../data/images_train.txt"</span>;</div><div class="line"><a class="code" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a> ptsFiles = <span class="stringliteral">"../data/points_train.txt"</span>;</div><div class="line">std::vector&lt;String&gt; images;</div><div class="line">std::vector&lt;std::vector&lt;Point2f&gt; &gt; facePoints;</div><div class="line"><a class="code" href="../../db/d7c/group__face.html#gacd36ecb8de65bd12d8420d4a0ae98a4b">loadTrainingData</a>(imageFiles, ptsFiles, images, facePoints, 0.0f);</div></div><!-- fragment --><p>example of content in the images_train.txt </p><div class="fragment"><div class="line">/home/user/ibug/image_003_1.jpg</div><div class="line">/home/user/ibug/image_004_1.jpg</div><div class="line">/home/user/ibug/image_005_1.jpg</div><div class="line">/home/user/ibug/image_006.jpg</div></div><!-- fragment --><p>example of content in the points_train.txt </p><div class="fragment"><div class="line">/home/user/ibug/image_003_1.pts</div><div class="line">/home/user/ibug/image_004_1.pts</div><div class="line">/home/user/ibug/image_005_1.pts</div><div class="line">/home/user/ibug/image_006.pts</div></div><!-- fragment --> 
</div>
</div>
<a id="gac3a2d046686d932425d2601b640d97d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac3a2d046686d932425d2601b640d97d3">◆ </a></span>loadTrainingData() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool cv::face::loadTrainingData </td>
          <td>(</td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; </td>
          <td class="paramname"><em>filename</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">Point2f</a> &gt; &gt; &amp; </td>
          <td class="paramname"><em>trainlandmarks</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::vector&lt; <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">String</a> &gt; &amp; </td>
          <td class="paramname"><em>trainimages</em> </td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table><table class="python_language"><tr><th colspan="999" style="text-align:left">Python:</th></tr><tr><td style="width: 20px;"></td><td>retval, facePoints</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">filename, images[, facePoints[, delim[, offset]]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>retval, facePoints</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">imageList, groundTruth, images[, facePoints[, offset]]</td><td>)</td></tr><tr><td style="width: 20px;"></td><td>retval</td><td>=</td><td>cv.face.loadTrainingData(</td><td class="paramname">filename, trainlandmarks, trainimages</td><td>)</td></tr></table>
</div><div class="memdoc">
<p><code>#include &lt;<a class="el" href="../../dc/dd9/facemark__train_8hpp.html">opencv2/face/facemark_train.hpp</a>&gt;</code></p>
<p>This function extracts the data for training from .txt files which contains the corresponding image name and landmarks. The first file in each file should give the path of the image whose landmarks are being described in the file. Then in the subsequent lines there should be coordinates of the landmarks in the image i.e each line should be of the form x,y where x represents the x coordinate of the landmark and y represents the y coordinate of the landmark. </p>
<p>For reference you can see the files as provided in the <a href="http://www.ifp.illinois.edu/~vuongle2/helen/">HELEN dataset</a></p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">filename</td><td>A vector of type <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a> containing name of the .txt files. </td></tr>
    <tr><td class="paramname">trainlandmarks</td><td>A vector of type <a class="el" href="../../dc/d84/group__core__basic.html#ga7d080aa40de011e4410bca63385ffe2a">cv::Point2f</a> that would store shape or landmarks of all images. </td></tr>
    <tr><td class="paramname">trainimages</td><td>A vector of type <a class="el" href="../../dc/d84/group__core__basic.html#ga1f6634802eeadfd7245bc75cf3e216c2">cv::String</a> which stores the name of images whose landmarks are tracked </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A boolean value. It returns true when it reads the data successfully and false otherwise </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.6-->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 2 2021 11:36:41 for OpenCV by  <a href="http://www.doxygen.org/index.html">
<img alt="doxygen" class="footer" src="../../doxygen.png"/>
</a> 1.8.13
</small></address>
<script type="text/javascript">
//<![CDATA[
addTutorialsButtons();
//]]>
</script>
</body>
</html>
